/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package Client;

/**
 *
 * @author Brandon
 */
public class Command {
    
    public static Comm comm = new Comm();
    private static String lastCommand = null;
    
    public Command() {
        
    }
    
    public static boolean connect(String ip,int port) {
        return comm.connect(ip,port);
    }
    
    public static void login(String name) {
    	lastCommand = "login";
        comm.send("login "+name);
    }
    
    public static void disconnect() {
        comm.send("disconnect");
    }
    
    public static void getGameList() {
        comm.send("get gamelist");
    }
    
    public static void getPlayerList() {
        comm.send("get playerlist");
    }
    
    public static void subscribe(String game) {
        comm.send("subscribe " + game);
    }
    
    public static void move(int move) {
        comm.send("move " + move);
    }
    
    public static void forfeit() {
        comm.send("forfeit");
    }
    
    public static void challenge(String player, String game) {
        comm.send("challenge \"" + player + "\"\" " + game);
    }
    
    public static void challengeAccept() {
        comm.send("challenge accept");
    }
    
    public static void help() {
        comm.send("help");
    }
    
    public static void help(String command) {
        comm.send("help " + command);
    }
    
    public static String getLastCommand() {
		return lastCommand;
	}
    
    public static void setLastCommand(String lastComand) {
		lastCommand = lastComand;
	}
}
